cmake_minimum_required(VERSION 3.5)

project(CEX LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(PkgConfig)

find_package(OpenSSL REQUIRED )
find_package (Boost 1.83.0 REQUIRED)

set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)

find_package (Boost 1.83.0 COMPONENTS thread chrono system json REQUIRED)
#pkg_check_modules(BOOST REQUIRED boost)
pkg_check_modules(GTKMM REQUIRED gtkmm-4.0)

#pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(GLIBMM REQUIRED glibmm-2.68)
pkg_check_modules(GLIB REQUIRED glib-2.0)

#include_directories(${GTKMM_INCLUDE_DIRS} ${GLIB_INCLUDE_DIRS}  "/home/user/projects/CEX/include/")
include_directories(${GTKMM_INCLUDE_DIRS} ${GLIB_INCLUDE_DIRS}  ${CMAKE_CURRENT_LIST_DIR}/include)

link_directories(${GTKMM_LIBRARY_DIRS} ${GLIB_LIBRARY_DIRS}   )
link_libraries(${GTKMM_LIBRARIES} )

if (Boost_FOUND)
#message(STATUS "bbb=" ${BOOST_INCLUDE_DIRS})
endif()
add_executable(cex main.cpp
    src/mainwindow.cpp
    include/mainwindow.h
    include/enums.h
    include/worker.h
    src/worker.cpp
    include/plotdata2d.h
    src/plotdata2d.cpp
    include/plotdata.h
    src/plotdata.cpp
    include/plot2d.h
    src/plot2d.cpp
    include/coin.h
    src/coin.cpp
    include/websocketstream.h
    src/websocketstream.cpp
)

target_link_libraries(cex OpenSSL::SSL OpenSSL::Crypto  ${GLIB_LDFLAGS} ${GTKMM_CFLAGS_OTHER} ${BOOST_LDFLAGS} "-lboost_thread" "-lboost_chrono" "-lboost_json" )
include(GNUInstallDirs)
install(TARGETS cex
    LIBRARY DESTINATION  ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION  ${CMAKE_INSTALL_BINDIR}
)

